package com.example.demo.entity;

import com.mybatisflex.annotation.Column;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

@Data
@Accessors(chain = true)
public class BaseEntity implements Serializable {
    
    /**
     * 创建人
     */
    @Column
    private Long createdBy;

    /**
     * 创建时间
     */
    @Column(onInsertValue = "now()")
    private LocalDateTime creationDate;

    /**
     * 最后修改用户id
     */
    @Column
    private Long lastUpdatedBy;

    /**
     * 最后登录用户
     */
    @Column
    private Long lastUpdateLogin;

    /**
     * 最后修改时间
     */
    @Column(onUpdateValue = "now()")
    private LocalDateTime lastUpdateDate;

    /**
     * 是否删除
     */
    @Column
    private Integer deleteFlag = 0;

    /**
     * 版本号
     */
    @Column(onUpdateValue = "version_num + 1", version = true)
    private Integer versionNum = 0;


}